# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.930.33.1 -> 1.930.33.2 # drivers/acpi/include/acpixf.h 1.6.1.1 -> 1.6.1.2 # drivers/acpi/include/acutils.h 1.7.1.1 -> 1.7.1.2 # drivers/acpi/resources/rsutils.c 1.5.1.1 -> 1.5.1.2 # drivers/acpi/include/acresrc.h 1.4.1.1 -> 1.4.1.2 # drivers/acpi/resources/rsxface.c 1.5.1.1 -> 1.5.1.2 # drivers/acpi/acpi_ksyms.c 1.10.1.2 -> 1.10.1.3 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/02/14 marcel@holtmann.org 1.884.46.4 # Cset exclude: marcel@holtmann.org|ChangeSet|20030208185812|16161 # -------------------------------------------- # 03/02/14 marcel@holtmann.org 1.884.46.5 # Cset exclude: marcel@holtmann.org|ChangeSet|20030122214259|16085 # -------------------------------------------- # 03/02/14 maxk@qualcomm.com 1.930.6.2 # Merge bk://linux-bt.bkbits.net/marcel-2.4 # into qualcomm.com:/usr/src/linux-2.4 # -------------------------------------------- # 03/02/14 jgarzik@redhat.com 1.930.1.59 # Merge redhat.com:/garz/repo/marcelo-2.4 # into redhat.com:/garz/repo/net-drivers-2.4 # -------------------------------------------- # 03/02/14 jgarzik@redhat.com 1.930.34.1 # Merge redhat.com:/garz/repo/marcelo-2.4 # into redhat.com:/garz/repo/arm-2.4 # -------------------------------------------- # 03/02/14 agrover@groveronline.com 1.937 # ACPI: Use extended IRQ resource type when setting IRQs on link devices to more # than IRQ 15 (Juan Quintela) # -------------------------------------------- # 03/02/14 agrover@groveronline.com 1.938 # ACPI: Properly handle an ISO reassigning the ACPI interrupt. Big thanks to # John Stultz. # -------------------------------------------- # 03/02/14 bjorn_helgaas@hp.com 1.930.33.2 # ACPI: Add acpi_walk_resources(). # -------------------------------------------- # diff -Nru a/drivers/acpi/acpi_ksyms.c b/drivers/acpi/acpi_ksyms.c --- a/drivers/acpi/acpi_ksyms.c Wed Oct 8 09:06:51 2003 +++ b/drivers/acpi/acpi_ksyms.c Wed Oct 8 09:06:51 2003 @@ -74,6 +74,7 @@ EXPORT_SYMBOL(acpi_release_global_lock); EXPORT_SYMBOL(acpi_get_current_resources); EXPORT_SYMBOL(acpi_get_possible_resources); +EXPORT_SYMBOL(acpi_walk_resources); EXPORT_SYMBOL(acpi_set_current_resources); EXPORT_SYMBOL(acpi_enable_event); EXPORT_SYMBOL(acpi_disable_event); diff -Nru a/drivers/acpi/include/acpixf.h b/drivers/acpi/include/acpixf.h --- a/drivers/acpi/include/acpixf.h Wed Oct 8 09:06:51 2003 +++ b/drivers/acpi/include/acpixf.h Wed Oct 8 09:06:51 2003 @@ -308,6 +308,11 @@ * Resource interfaces */ +typedef +acpi_status (*acpi_walk_resource_callback) ( + struct acpi_resource *resource, + void *context); + acpi_status acpi_get_current_resources( acpi_handle device_handle, @@ -317,6 +322,13 @@ acpi_get_possible_resources( acpi_handle device_handle, acpi_buffer *ret_buffer); + +acpi_status +acpi_walk_resources ( + acpi_handle device_handle, + char *path, + acpi_walk_resource_callback user_function, + void *context); acpi_status acpi_set_current_resources ( diff -Nru a/drivers/acpi/include/acresrc.h b/drivers/acpi/include/acresrc.h --- a/drivers/acpi/include/acresrc.h Wed Oct 8 09:06:51 2003 +++ b/drivers/acpi/include/acresrc.h Wed Oct 8 09:06:51 2003 @@ -48,6 +48,12 @@ acpi_buffer *ret_buffer); acpi_status +acpi_rs_get_method_data ( + acpi_handle handle, + char *path, + acpi_buffer *ret_buffer); + +acpi_status acpi_rs_set_srs_method_data ( acpi_handle handle, acpi_buffer *ret_buffer); diff -Nru a/drivers/acpi/include/acutils.h b/drivers/acpi/include/acutils.h --- a/drivers/acpi/include/acutils.h Wed Oct 8 09:06:51 2003 +++ b/drivers/acpi/include/acutils.h Wed Oct 8 09:06:51 2003 @@ -439,6 +439,8 @@ #define METHOD_NAME__SEG "_SEG" #define METHOD_NAME__BBN "_BBN" #define METHOD_NAME__PRT "_PRT" +#define METHOD_NAME__CRS "_CRS" +#define METHOD_NAME__PRS "_PRS" acpi_status diff -Nru a/drivers/acpi/resources/rsutils.c b/drivers/acpi/resources/rsutils.c --- a/drivers/acpi/resources/rsutils.c Wed Oct 8 09:06:51 2003 +++ b/drivers/acpi/resources/rsutils.c Wed Oct 8 09:06:51 2003 @@ -261,6 +261,84 @@ /******************************************************************************* * + * FUNCTION: acpi_rs_get_method_data + * + * PARAMETERS: Handle - a handle to the containing object + * ret_buffer - a pointer to a buffer structure for the + * results + * + * RETURN: Status + * + * DESCRIPTION: This function is called to get the _CRS or _PRS value of an + * object contained in an object specified by the handle passed in + * + * If the function fails an appropriate status will be returned + * and the contents of the callers buffer is undefined. + * + ******************************************************************************/ + +acpi_status +acpi_rs_get_method_data ( + acpi_handle handle, + char *path, + acpi_buffer *ret_buffer) +{ + acpi_operand_object *ret_obj; + acpi_status status; + + + ACPI_FUNCTION_TRACE ("rs_get_method_data"); + + + /* Parameters guaranteed valid by caller */ + + /* + * Execute the method, no parameters + */ + status = acpi_ns_evaluate_relative (handle, path, NULL, &ret_obj); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + + if (!ret_obj) { + /* Return object is required */ + + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No object was returned from %s\n", path)); + return_ACPI_STATUS (AE_TYPE); + } + + /* + * The return object will be a buffer, but check the + * parameters. If the return object is not a buffer, + * then the underlying AML code is corrupt or improperly + * written.. + */ + if (ACPI_TYPE_BUFFER != ret_obj->common.type) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%s did not return a Buffer, returned %s\n", + path, + acpi_ut_get_type_name (ret_obj->common.type))); + status = AE_AML_OPERAND_TYPE; + goto cleanup; + } + + /* + * Make the call to create a resource linked list from the + * byte stream buffer that comes back from the method + * execution. + */ + status = acpi_rs_create_resource_list (ret_obj, ret_buffer); + + /* on exit, we must delete the object returned by evaluate_object */ + +cleanup: + + acpi_ut_remove_reference (ret_obj); + return_ACPI_STATUS (status); +} + + +/******************************************************************************* + * * FUNCTION: Acpi_rs_set_srs_method_data * * PARAMETERS: Handle - a handle to the containing object diff -Nru a/drivers/acpi/resources/rsxface.c b/drivers/acpi/resources/rsxface.c --- a/drivers/acpi/resources/rsxface.c Wed Oct 8 09:06:51 2003 +++ b/drivers/acpi/resources/rsxface.c Wed Oct 8 09:06:51 2003 @@ -194,6 +194,89 @@ /******************************************************************************* * + * FUNCTION: acpi_walk_resources + * + * PARAMETERS: device_handle - a handle to the device object for the + * device we are querying + * path - method name of the resources we want + * (METHOD_NAME__CRS or METHOD_NAME__PRS) + * user_function - called for each resource + * context - passed to user_function + * + * RETURN: Status + * + * DESCRIPTION: Retrieves the current or possible resource list for the + * specified device. The user_function is called once for + * each resource in the list. + * + ******************************************************************************/ + +acpi_status +acpi_walk_resources ( + acpi_handle device_handle, + char *path, + acpi_walk_resource_callback user_function, + void *context) +{ + acpi_status status; + acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; + acpi_resource *resource; + + ACPI_FUNCTION_TRACE ("acpi_walk_resources"); + + + if (!device_handle || + (ACPI_STRNCMP (path, METHOD_NAME__CRS, sizeof (METHOD_NAME__CRS)) && + ACPI_STRNCMP (path, METHOD_NAME__PRS, sizeof (METHOD_NAME__PRS)))) { + return_ACPI_STATUS (AE_BAD_PARAMETER); + } + + status = acpi_rs_get_method_data (device_handle, path, &buffer); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + + resource = (struct acpi_resource *) buffer.pointer; + for (;;) { + if (!resource || resource->id == ACPI_RSTYPE_END_TAG) + break; + + status = user_function (resource, context); + + switch (status) { + case AE_OK: + case AE_CTRL_DEPTH: + + /* Just keep going */ + status = AE_OK; + break; + + case AE_CTRL_TERMINATE: + + /* Exit now, with OK stats */ + + status = AE_OK; + goto end; + + default: + + /* All others are valid exceptions */ + + goto end; + } + + resource = ACPI_NEXT_RESOURCE (resource); + } + +end: + acpi_os_free (buffer.pointer); + + return_ACPI_STATUS (status); +} + + +/******************************************************************************* + * * FUNCTION: Acpi_set_current_resources * * PARAMETERS: Device_handle - a handle to the device object for the